/**
 *  
 *  Copyright (c) 2011,
 *  GaoTime
 *  All rights reserved.  
 *   
 *  @file       Gui_Rect.h
 *  @brief      区域结构工具 
 *   
 *  本工具为跨平台结构  
 *   
 *  @version    1.1
 *  @author     imuse
 *  @date       2011-06-16
 *   
 *   
 *  修订说明：最初版本  
 */
#ifndef GUI_RECT_H
#define GUI_RECT_H

///区域结构
typedef struct GUI_RECT_tag
{
    ///左坐标
	int nLeft;
    ///顶坐标
	int nTop;
    ///右坐标
	int nRight;
    ///底坐标
	int nBottom;
}GUI_RECT;

///点结构
typedef struct GUI_POINT_tag
{
    ///x坐标
	int x;
    ///y坐标
	int y;
}GUI_POINT;

///判断坐标是否在指定区域内
#define Rect_IsInRect(pRect, x, y) (pRect->nLeft<=x && pRect->nRight >=x && pRect->nTop<=y && pRect->nBottom>=y)

///获得指定区域的宽
#define Rect_GetWidth(pRect) (pRect->nRight - pRect->nLeft)

///获得指定区域的高
#define Rect_GetHeight(pRect) (pRect->nBottom - pRect->nTop)

#endif
